<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <button>点我跳转并且携带哈希参数</button>
    <script>
      //地址栏的哈希参数: 参数是地址#后的内容
      //queryString 参数是?后面的内容
      //跳转的时候携带哈希参数
      var btn = document.querySelector("button");
      btn.onclick = function () {
        window.location.href = "./a.html#mypage";
      };
    </script>
  </body>
</html>
